package com.rabit.controller;

import com.rabit.entity.User;
import com.rabit.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.jws.WebParam;

/**
 * @author Rabit
 */
@Controller
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping("/index")
    public String index(Model model){
        System.out.println("111");
        User user=userService.findOne().get(0);
        model.addAttribute("user",user);
        return "index";
    }
}
